<?php

namespace Apps\Common\Models;

/**
 * 活动回复Model
 * @author     chenxiaolin
 * @date        2016年1月19日
 * @version     2.0.0
 * @copyright   Copyright 2016 meelier.com
 */
class ActivityComment extends \PhalconPlus\Database\Model
{

    /**
     *
     * @var integer
     */
    public $comment_id;

    /**
     *
     * @var integer
     */
    public $comment_user_id;

    /**
     *
     * @var string
     */
    public $comment_content;

    /**
     *
     * @var string
     */
    public $addtime;

    /**
     *
     * @var string
     */
    public $updatetime;
    
    public $activity_id;
    
    public $state;



    /**
     * Returns table name mapped in the model.
     *
     * @return string
     */
    public function getSource()
    {
        return 'activity_comment';
    }

    /**
     * Allows to query a set of records that match the specified conditions
     *
     * @param mixed $parameters
     * @return Activity[]
     */
    public static function find($parameters = null)
    {
        return parent::find($parameters);
    }

    /**
     * Allows to query the first record that match the specified conditions
     *
     * @param mixed $parameters
     * @return Activity
     */
    public static function findFirst($parameters = null)
    {
        return parent::findFirst($parameters);
    }

    /**
     * Independent Column Mapping.
     * Keys are the real names in the table and the values their names in the application
     *
     * @return array
     */
    public function columnMap()
    {
        return array(
            'comment_id' => 'comment_id',
            'comment_user_id' => 'comment_user_id',
            'comment_content' => 'comment_content',
            'addtime' => 'addtime',
            'updatetime' => 'updatetime',
            'activity_id' => 'activity_id',
            'state' => 'state'
        );
    }

    public function defaultColumns()
    {
        return [
            'addtime',
            'state'
        ];
    }

}
